package com.example.demo;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

/*
    创建消息消费
 */
@Component
@RabbitListener(queues = "hello")
public class Receiver {
   @RabbitHandler
    public void process(String hello){
       System.out.println("Receiver:"+hello);
   }
}
